<template>
	<view class="content">
		<u-cell-group>
			<u-cell title="关于我们" :isLink="true" arrow-direction="right"></u-cell>
			<u-cell title="常见问题" :isLink="true"  arrow-direction="right"></u-cell>
		</u-cell-group>
		
		<view style="margin-top: 60px;">
			<u-button type="primary" text="退出登录" @click="toLogout"></u-button>
		</view>
	</view>
</template>

<script>
	import {handleLoginStorage,readLoginStorage,clearLogin, getToken,logout} from '@/api/auth.js'
	export default{
		methods:{
			
			toLogout(){
				 
				 let that=this;
				 uni.showModal({
				 	title: '温馨提示',
				 	content: '确定提交吗？',
				 	success: res => {
						
				 		if (res.confirm) {
				 			uni.showLoading({
				 				mask: true,
				 				title: '加载中'
				 			});
				 			//退出登录
				 			logout().then(res=>{
				 								
								 uni.hideLoading();
								 clearLogin();
								 that.$store.commit("clearToken");	
								 uni.navigateBack();
				 			}).catch(err=>{
								 uni.hideLoading();
				 			})
				 			 
				 		}
				 	}
				 })
				 
			}
		}
	}
</script>

<style>
</style>